package com.calm.editor.handler;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.calm.editor.api.PageService;
import com.calm.editor.entity.Page;
import com.calm.editor.servlet.Result;

@Service("page")
@Transactional
public class PageServiceImpl extends BaseService<Page> implements PageService{
	@Override
	public void getById(Integer id,Result<Page> result){
		result.setEvent("loadPage");
		Page byId = getById(id);
		result.setData(byId);
	}
	@Override
	@Transactional
	public void update(Page id,Result<String> result){
		result.setEvent("saveNode");
//		Page byId = getById(id.getId());
//		byId.setTitle(id.getTitle());
		update(id);
	}
	
	@Override
	public Class<Page> getEntityClass() {
		return Page.class;
	}
}
